package com.android.delivery.adapter

import com.android.delivery.R
import com.android.delivery.entity.AccountBill
import com.android.delivery.entity.Addr
import com.android.delivery.util.DateFormatUtil
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder

/**
 * @author: mqwang
 * @create: 2/10/21 12:11 AM
 * @Description: 资金明细
 */
class CapitalAdapter : BaseQuickAdapter<AccountBill, BaseViewHolder>(R.layout.adapter_capital) {

    override fun convert(helper: BaseViewHolder, item: AccountBill) {
        helper.setText(R.id.tv_title, item.desc)
        helper.setText(R.id.tv_time, DateFormatUtil.formatDate(item.createdTime!!, "yyyy-MM-dd HH:mm:ss"))
        if (item.amount!! > 0){
            helper.setText(R.id.tv_money, String.format("+%.2f", item.amount!!))
        }else{
            helper.setText(R.id.tv_money, String.format("%.2f", item.amount!!))
        }
    }
}